class Solution {
    public boolean CheckPermutation(String s1, String s2) {
        int hash[] = new int[26];
        if(s1.length()!=s2.length())    return false;
        for(int i=0;i<s1.length();i++){
            hash[s1.charAt(i)-'a']++;
        }
        for(int i=0;i<s1.length();i++){
            hash[s2.charAt(i)-'a']--;
            if(hash[s2.charAt(i)-'a']<0)    return false;
        }
        return true;
    }
}